﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;

namespace Himp.Platform.Dc
{
    /// <summary>
    /// 药品基本信息
    /// </summary>
    [Table("DRUG_BAS_INFO")]
    public class DrugBasInfo : Entity<Guid>, IMultiTenant
    {
        /// <summary>
        /// 
        /// </summary>
        public Guid DrugTypeId { get; set; }

        /// <summary>
        /// 药品类别
        /// </summary>
        public DrugType DrugType { get; set; }

        /// <summary>
        /// 默认收费项目类别
        /// </summary>
        public Guid DefChrgitmTypeId { get; set; }

        /// <summary>
        /// 药理类别
        /// </summary>
        public Guid PhamTypeId { get; set; }

        /// <summary>
        /// 药理类别
        /// </summary>
        public PhamType PhamType { get; set; }

        /// <summary>
        /// 药品代码
        /// </summary>
        [Column("DRUG_CODE")]
        public string DrugCode { get; set; }

        /// <summary>
        /// 药品名称
        /// </summary>
        [Column("DRUG_NAME")]
        public string DrugName { get; set; }

        /// <summary>
        /// 药品通用名
        /// </summary>
        [Column("DRUG_GENNAME")]
        public string DrugGenname { get; set; }

        /// <summary>
        /// 别名
        /// </summary>
        [Column("ALIS")]
        public string Alis { get; set; }

        /// <summary>
        /// 拼音助记码
        /// </summary>
        [Column("PINYINCODE")]
        public string Pinyincode { get; set; }

        /// <summary>
        /// 五笔助记码
        /// </summary>
        [Column("WUBICODE")]
        public string Wubicode { get; set; }

        /// <summary>
        /// 剂型Id
        /// </summary>
        public Guid DrugDosformId { get; set; }

        /// <summary>
        /// 剂型
        /// </summary>
        public DrugDosform DrugDosform { get; set; }

        /// <summary>
        /// 用法/药物使用-途径代码
        /// </summary>
        public Guid DefDrugMedcWayDictId { get; set; }

        /// <summary>
        /// 频次/使用频次（used_frqu）
        /// </summary>
        public Guid DefUsedFrquDictId { get; set; }

        #region  药品使用条件 限制类型 应用到公共项目中设置

        ///// <summary>
        ///// 药品使用条件
        ///// 0全部
        ///// 1医生
        ///// 2护士
        ///// </summary>
        //public EnumUsageConditions UsageConditions { get; set; }

        ///// <summary>
        ///// 限制类型 1-无限制 2-限制 3-特殊 9--99
        ///// </summary>
        //public EnumRestrictionType RestrictionType { get; set; }

        #endregion

        #region todo 药品属性 迁移到扩展属性

        ///// <summary>
        ///// 贵重标志
        ///// </summary>
        //public bool? ValuableFlag { get; set; }

        ///// <summary>
        ///// 毒药标志
        ///// </summary>
        //public bool? PoisonFlag { get; set; }

        ///// <summary>
        ///// 麻醉药标识
        ///// </summary>
        //public bool? EphedrineFlag { get; set; }

        ///// <summary>
        ///// 精一药标志
        ///// </summary>
        //public bool? PsychotropicDrugs1Flag { get; set; }

        ///// <summary>
        ///// 精二药标志
        ///// </summary>
        //public bool? PsychotropicDrugs2Flag { get; set; }

        ///// <summary>
        ///// 放射药标志
        ///// </summary>
        //public bool? RadiopharmaceuticalsFlag { get; set; }

        ///// <summary>
        ///// 新药标志
        ///// </summary>
        //public bool? NewDrugFlag { get; set; }

        ///// <summary>
        ///// 审批标志
        ///// </summary>
        //public bool? AuditFlag { get; set; }

        ///// <summary>
        ///// 公示标志
        ///// </summary>
        //public bool? PublicityFlag { get; set; }

        ///// <summary>
        ///// 中药成分标志
        ///// </summary>
        //public bool? ChineseHerbFlag { get; set; }

        ///// <summary>
        ///// 免煎标志
        ///// </summary>
        //public bool? NonDecoctionFlag { get; set; }

        ///// <summary>
        ///// 药房使用标志
        ///// </summary>
        //public bool? PharmacyUseFlag { get; set; }

        ///// <summary>
        ///// 大输液药品标志
        ///// </summary>
        //public bool? LargeInfusionDrugsFlag { get; set; }

        ///// <summary>
        ///// 基本用药标志
        ///// </summary>
        //public bool? BasicMedicationFlag { get; set; }

        ///// <summary>
        ///// 医保用药标志
        ///// </summary>
        //public bool? MedicareMedicationFlag { get; set; }

        ///// <summary>
        ///// 自制药品标志
        ///// </summary>
        //public bool? HomemadeDrugsFlag { get; set; }

        ///// <summary>
        ///// 皮试药品标志
        ///// </summary>
        //public bool? SkinTestDrugFlag { get; set; }

        ///// <summary>
        ///// 门诊控制标志
        ///// </summary>
        //public bool? OutpatientControlFlag { get; set; }

        ///// <summary>
        ///// 处方药标识
        ///// </summary>
        //public bool? PrescriptionDrugFlag { get; set; }

        #endregion

        /// <summary>
        /// 
        /// </summary>
        [Column("VALI_FLAG")]
        public bool ValiFlag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        /// <summary>
        /// 药品目录
        /// </summary>
        public List<DrugCatalog> DrugCatalogs { get; set; }


        public DrugBasInfo()
        { 
        
        }

        public DrugBasInfo(Guid drugTypeId, Guid phamTypeId, Guid defChrgitmTypeId, string drugCodg, string drugName
            , Guid drugDosformId, Guid defDrugMedcWayDictId, Guid defUsedFrquDictId)
        { 
            DrugTypeId = drugTypeId;
            PhamTypeId = phamTypeId;
            DefChrgitmTypeId = defChrgitmTypeId;
            DrugCode = drugCodg;
            DrugName = drugName;
            DrugDosformId = drugDosformId;
            DefDrugMedcWayDictId = defDrugMedcWayDictId;
            DefUsedFrquDictId = defUsedFrquDictId;
        }
    }
}
